@extends('layouts.information')

@section('content')
    <div class="row">
        <div class="col-sm-12 us_sheet_ves">
            <div class="us_sheet">
                <div class="us_sheet-child">
                    <table>
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>展示名称</th>
                            <th></th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($perms as $perm)
                            <tr>
                                <td><a href="{{ route('permission.show',['id'=>$perm->id])}}">{{ $perm->id }}</a></td>
                                <td>{{ $perm->display_name }}</td>
                                <td>
                                    <ul>
                                        <li>
                                            <a href="{{ route('permission.show', [ 'id'=> $perm->id ]) }}">查看</a>
                                        </li>
                                        <li>
                                            <a href="{{ route('permission.unassign', [ 'role_id'=> $role->id,'permssion_id'=>$perm->id ]) }}">取消</a>
                                        </li>
                                    </ul>
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
            <nav class="pull-right">
                {{ $perms->links() }}
            </nav>
        </div>
    </div>

    <ul>
        <li>
            <a href="{{ route('permission.assign',['role_id'=>$role->id]) }}">添加权限</a>
        </li>
    </ul>
@endsection
